function diff = delta_p_fun(m,param)
    % derivative of delta(m)
    if param.K == 0
        diff=0.*(m<param.m_h) ...
            +(m>=param.m_h).*(m<=param.m_u).*delta_OJS_p(m,param)...
            +(m>param.m_u).*0;    
    else
        diff= 0.*(m<param.m_h) ...
            +(m>=param.m_h).*(m<param.m_e).*delta_m_p(m,param) ...
            +(m>=param.m_e).*(m<=param.m_u).*delta_u_p(m,param) ...
            +(m>param.m_u).*0;
    end

end